
import { baseUrlApi, requestClient, type Result } from '#/api/request';

export const getCatalogCategory = () => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/catalog/getCategoryList'));
};

export const CatalogList = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/catalog/CatalogList'), data);
};
export const UpdateName = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/catalog/update/name'), data);
};

//批量删除
export const batchdelete = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/catalog/batch/delete'), data);
};

/** 删除 */
export const deleteCatlog = (id: number) => {
  return requestClient.delete<Result>(
    baseUrlApi(`/portal/admin/catalog/${id}`),
  );
};

export const UpdateSort = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/catalog/upload/sort'), data);
};

export const UpdateCoverImage = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/catalog/save/CoverImage'), data);
};


